// 引入需要的模块
import {createRouter, createWebHistory} from "vue-router";
// 下面使用了es6的对象增强写法，命名必须是routes
export const routes = [
    //默认展示，这是主页面路由必须加斜杠  路由懒加载
    {path: "/", component: () => import("../pages/home/index.vue"), title: "主页"},
    {path: "/home", component: () => import("../pages/home/index.vue"), title: "主页"},
    {path: "/login", component: () => import("../pages/login/index.vue"), title: "登录"},
    {path: "/team", component: () => import("../pages/team/index.vue"), title: "队伍"},
    {path: "/team/add", component: () => import("../pages/addTeam/index.vue"), title: "创建队伍"},
    {path: "/team/update/:id", component: () => import("../pages/updateTeam/index.vue"), title: "更新队伍"},
    {path: "/user", component: () => import("../pages/user/index.vue"), title: "我的"},
    {path: "/user/info", component: () => import("../pages/userInfo/index.vue"), title: "个人信息"},
    {path: "/user/my/create", component: () => import("../pages/userMyCreateTeam/index.vue"), title: "创建的队伍"},
    {path: "/user/my/join", component: () => import("../pages/userMyJoinTeam/index.vue"), title: "加入的队伍"},
    {path: "/user/edit", component: () => import("../pages/edit/index.vue"), title: "编辑信息"},
    {path: "/search", component: () => import("../pages/search/index.vue"), title: "匹配用户"},
    {path: "/search/searchResult", component: () => import("../pages/searchResult/index.vue"), title: "匹配结果"},

];

// 创建路由
const router = createRouter({
    history: createWebHistory(),
    routes,
});

// 导出路由
export default router;